package com.cloudlead.common.worker.validator;

import java.lang.annotation.Annotation;

import javax.validation.Payload;

import com.fasterxml.jackson.annotation.JsonTypeName;

@SuppressWarnings("all")
@JsonTypeName("pattern")
public class PatternValidator extends Validator implements
		javax.validation.constraints.Pattern {

	private String regexp;

	private Flag[] flags;

	private String message;

	private Class<?>[] groups;

	private Class<? extends Payload>[] payload;

	public PatternValidator() {
		super();
		message = "{javax.validation.constraints.Pattern.message}";
	}

	public PatternValidator(String regexp, Flag[] flags, String message,
			Class<?>[] groups, Class<? extends Payload>[] payload) {
		super();
		this.regexp = regexp;
		this.flags = flags;
		this.message = message;
		this.groups = groups;
		this.payload = payload;
	}

	@Override
	public Class<? extends Annotation> annotationType() {
		return javax.validation.constraints.Pattern.class;
	}

	@Override
	public String message() {
		return message;
	}

	@Override
	public Class<?>[] groups() {
		return groups;
	}

	@Override
	public Class<? extends Payload>[] payload() {
		return payload;
	}

	@Override
	public String regexp() {
		return regexp;
	}

	@Override
	public Flag[] flags() {
		return flags;
	}

	public String getRegexp() {
		return regexp;
	}

	public void setRegexp(String regexp) {
		this.regexp = regexp;
	}

	public Flag[] getFlags() {
		return flags;
	}

	public void setFlags(Flag[] flags) {
		this.flags = flags;
	}

}
